pattern program without loops